% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/epm_weibull.r
\name{epm_weibull}
\alias{epm_weibull}
\title{Expected profit model weibull catch function}
\usage{
epm_weibull(starts3, dat, otherdat, alts)
}
\arguments{
\item{starts3}{Starting values as a vector (num). For this likelihood,
the order takes: c([catch-function parameters], [travel-distance
parameters], [catch sigma(s)], [scale parameter]). \cr \cr
The catch-function and travel-distance parameters are of length (# of
catch-function variables)*(k) and (# of travel-distance variables)
respectively, where (k) equals the number of alternatives. The catch
sigma(s) are either of length equal to unity or length (k) if the
analyst is estimating location-specific catch sigma parameters. The
scale parameter is of length equal to unity.}

\item{dat}{Data matrix, see output from shift_sort_x, alternatives with
distance.}

\item{otherdat}{Other data used in model (as a list containing objects
`intdat`, `griddat`, and `prices`). \cr \cr
For this likelihood, `intdat` are "travel-distance variables", which
are alternative-invariant variables that are interacted with travel
distance to form the cost portion of the likelihood. Each variable
name therefore corresponds to data with dimensions (number of
observations) by (unity), and returns a single parameter. \cr \cr
In `griddat` are "catch-function variables" that are
alternative-invariant variables that are interacted with zonal
constants to form the catch portion of the likelihood. Each variable
name therefore corresponds to data with dimensions (number of
observations) by (unity), and returns (k) parameters where (k) equals
the number of alternatives. \cr \cr
For "catch-function variables" `griddat` and "travel-distance
variables" `intdat`, any number of variables are allowed, as a list
of matrices. Note the variables (each as a matrix) within `griddat`
`intdat` have no naming restrictions. "Catch-function variables" may
correspond to variables that impact catches by location, or
interaction variables may be vessel characteristics that affect how
much disutility is suffered by traveling a greater distance. Note in
this likelihood the "catch-function variables" vary across
observations but not for each location: they are allowed to impact
catches differently across alternatives due to the location-specific
coefficients. If there are no other data, the user can set `griddat`
as ones with dimension (number of observations) x (number of
alternatives) and `intdat` variables as ones with dimension (number
of observations) by (unity). \cr \cr
The variable `prices` is a matrix of dimension (number of
observations) by (unity), corresponding to prices.}

\item{alts}{Number of alternative choices in model as length equal to
unity (as a numeric vector).}
}
\value{
ld: negative log likelihood
}
\description{
Expected profit model weibull catch function
}
\section{Graphical examples}{
 
\if{html}{
\figure{epm_weibull_grid.png}{options: width="40\%" 
alt="Figure: epm_weibull_grid.png"}
\cr
\figure{epm_weibull_travel.png}{options: width="40\%" 
alt="Figure: epm_weibull_travel.png"}
\cr
\figure{epm_weibull_sigma.png}{options: width="40\%" 
alt="Figure: epm_weibull_sigma.png"}
}
}

\examples{
data(zi)
data(catch)
data(choice)
data(distance)
data(si)
data(prices)

catch[catch<0] <- 0.00001
#Note weibull catch distribution.

optimOpt <- c(1000,1.00000000000000e-08,1,0)

methodname <- 'BFGS'

si2 <- sample(1:5,dim(si)[1],replace=TRUE)
zi2 <- sample(1:10,dim(zi)[1],replace=TRUE)

otherdat <- list(griddat=list(si=as.matrix(si),si2=as.matrix(si2)),
    intdat=list(zi=as.matrix(zi),zi2=as.matrix(zi2)),
    pricedat=list(prices=as.matrix(prices)))

initparams <- c(2.5, 2.0, 1.5, 1.0, 1.1, 1.05, 0.9, 0.8, -0.8, -0.4, 3,
    2, 3.5, 2.5, 1)

func <- epm_weibull

results <- discretefish_subroutine(catch,choice,distance,otherdat,
    initparams,optimOpt,func,methodname)

}
